package com.job.blossom.work0712;

/**
 * @author ZJM
 * @version 1.0
 * @since 2022-07-12 19:33:29
 */
public class TestTiger {
    public static void main(String[] args) {
        MainTiger tiger1 = new MainTiger();
        tiger1.setName("辛巴");

        AttackWay attackWay = new AttackWay() {
            @Override
            public void attackMethod() {
                System.out.println("历经千难万险终于打败敌人成为狮子王");
            }
        };
        tiger1.attack();

        tiger1.setAttackWay(new NormalAttack());
        tiger1.attack();

        tiger1.setAttackWay(new DoubleAttack());
        tiger1.attack();

        tiger1.setAttackWay(new SuperAttack());
        tiger1.attack();
    }
}
